﻿using Dispatcher.Core.Message.Models;
using Microsoft.AspNetCore.Mvc;
using MiniFox.Infrastructure;
using MiniFox.Platform.Applications.Web;
using MiniFox.Utility;
using MiniFox.Web.Infrastructure;

namespace Dispatcher.Core.Message
{
    /// <summary>
    /// 
    /// </summary>
    [NoCache]
    public class MessageController : AuthorizedController<MessageEngineService>
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<Response<MessageSendResponse>> SendAsync([FromBody] MessageSendRequest request)
        {
            var result = await this.Component.SendAsync(request);

            return result.CreateResponse();
        }
    }
}
